package com.feihao.zhou;

import com.feihao.zhou.config.SpringConfig;
import com.feihao.zhou.config.TestProperties;
import com.feihao.zhou.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.sql.DataSource;

public class Test {
    public static void main(String[] args) {
//        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        ApplicationContext ac = new AnnotationConfigApplicationContext(SpringConfig.class);
        UserService userService = (UserService) ac.getBean("userService");
        userService.say();
//        ApplicationContext ac = new AnnotationConfigApplicationContext(SpringConfig.class);
//        DataSource dataSource = (DataSource) ac.getBean("dataSource");
//        System.out.println(dataSource);


//        ApplicationContext ac = new AnnotationConfigApplicationContext(SpringConfig.class);
//        TestProperties testProperties = (TestProperties) ac.getBean("testProperties");
//        testProperties.test();

    }
}
